﻿@model Alumnado.Models.Alumno

@{
    ViewBag.Title = "Details";
}
<style>
    .text-left {
        text-align: left;
    }
    .text-middle {
        text-align: center;
    }
</style>
<h2>Details</h2>

<fieldset>
    <legend>Alumno</legend>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.nombre): @Html.DisplayFor(model => model.nombre)
    </div>
    <div class="display-label">
         @Html.DisplayNameFor(model => model.apellido): @Html.DisplayFor(model => model.apellido)
    </div>
    <div class="display-label">
         @Html.DisplayNameFor(model => model.dni): @Html.DisplayFor(model => model.dni)
    </div>
    <div class="display-label">
         @Html.DisplayNameFor(model => model.curso): @Html.DisplayFor(model => model.curso)
    </div>

    <table border="1">
        <thead>
            <tr>
                <th>materia</th>
                <th>nota</th>
                <th> operaciones</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var i in ViewBag.lista)
            {
                <tr>
                    <td>@i.nombre</td>
                    <td>@i.nota</td>
                    <td>
                        <form action="@Url.Action("Details", "Materia")" method="post">
                            <input type="hidden" name="id" value="@i.id" />
                            <input type="submit" value="Modificar Nota" />
                        </form>
                        <form action="@Url.Action("Delete", "Materia")" method="post">
                            <input type="hidden" name="id" value="@i.id" />
                            <input type="submit" value="Borrar Nota" />
                        </form>
                    </td>
                </tr>
            }
            <tr>
                <td class="text-middle" colspan="3">
                    <form action="@Url.Action("Create", "Materia")">
                            <input type="submit" value="Agregar Nota" />
                        </form>
                </td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <th colspan="1">Promedio</th>
                <th class="text-left" colspan="2">@ViewBag.promedio</th>
            </tr>
        </tfoot>
    </table>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.id }) |
    @Html.ActionLink("Back to List", "Index") |
</p>
